<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>
<style>
  h1 {
    font-size:2rem;
  }
</style>
<body>
  <h1>哈哈哈哈哈哈哈哈我来适配rem试试</h1>
  <script>
// setTimeout(()=>{
//   console.log(1);
// })
// console.log(2);
// new Promise((resolve,reject)=>{
//   resolve(3);
//   console.log(4);
// }).then(r=>{
//   console.log(r);
// });
// console.log(5)
var oHtml = document.getElementsByTagName('html')[0];
var owidth = oHtml.clientWidth;
var realSize = oHtml.style.fontSize = 12 * (owidth / 320) + "px";
console.log(realSize)
  </script>
</body>
</html>